import _ from "lodash";
import "./style.css";
import myimage from "./timg.jpg";

function createDiv() {
	var ele = document.createElement("div");

	// Lodash（目前通过一个 script 脚本引入）对于执行这一行是必需的

	// 现在lodash通过importe引入了
	ele.innerHTML = _.join(['Hello,welcome to', 'webpack, again;这次我使用了css loader和style loader,file loader'], ' ');
	ele.classList.add("hello");

	// 将图片添加到div
	var img = new Image();
	img.src = myimage;

	ele.appendChild(img);
	
	return ele;
}

document.body.appendChild(createDiv());